package com.os.simulator.process;

import javafx.beans.Observable;

import java.io.Serializable;

public interface IProcessManager extends Observable, Serializable {

	/**
	 * 设置算法调度器
	 *
	 * @param scheduler 算法调度器
	 */
	void setScheduler(IScheduler scheduler);

	/**
	 * 创建一个进程
	 *
	 * @return 返回创建好的进程
	 *
	 * @throws Exception 失败时抛出异常
	 */
	IProcess createProcess() throws Exception;

	/**
	 * 销毁一个进程
	 *
	 * @param iProcess 要销毁的进程
	 *
	 * @throws Exception 失败时抛出异常
	 */
	void destroyProcess(IProcess iProcess) throws Exception;

	/**
	 * 阻塞进程,
	 *
	 * @param iProcess 要阻塞的进程
	 *
	 * @throws Exception 失败时抛出异常
	 */
	void blockProcess(IProcess iProcess) throws Exception;

	/**
	 * 唤醒一个进程
	 *
	 * @param iProcess 要唤醒的进程
	 *
	 * @throws Exception 失败时抛出异常
	 */
	void wackUpProcess(IProcess iProcess) throws Exception;
}
